<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<%
	//得到URL中的参数username
	String getname = request.getParameter("username");
	System.err.println("得到URL中的参数username:" + getname);

	//把得到的参数重新设置Cookie
	Cookie cookie = new Cookie("cong", getname);
	cookie.setMaxAge(60000);
	response.addCookie(cookie);

	//getCookie
	Cookie cookies[] = request.getCookies();
	Cookie c1 = null;
	String username = "";

	if (cookies != null) {
		for (Cookie c : cookies) {
			if (c.getName().equals("cong")) {
				username = c.getValue();

			}
		}
	}

	System.out.println("Cookie:" + username);
%>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SpaceLab</title>
<meta name="description" content="">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Favicon -->
<link rel="shortcut icon" href="assets/img/favicon.ico"
	type="image/x-icon">
<!-- Bootstrap core CSS -->
<link rel="stylesheet"
	href="assets/plugins/bootstrap/css/bootstrap.min.css">
<!-- Fonts from Font Awsome -->
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<!-- CSS Animate -->
<link rel="stylesheet" href="assets/css/animate.css">
<!-- Custom styles for this theme -->
<link rel="stylesheet" href="assets/css/main.css">
<!-- Fonts -->
<!-- <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic' rel='stylesheet' type='text/css'>
   <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> -->
<!-- Feature detection -->
<script src="assets/js/modernizr-2.6.2.min.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
    <script src="assets/js/html5shiv.js"></script>
    <script src="assets/js/respond.min.js"></script>
    <![endif]-->

<script type="text/javascript" src="js/navto.js"></script>
<script type="text/javascript" src="js/goeasy.js"></script>
<script type="text/javascript" src="js/getMes.js"></script>

<!--Global JS-->
<script src="assets/js/jquery-1.10.2.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/plugins/waypoints/waypoints.min.js"></script>
<script src="assets/js/application.js"></script>

<script type="text/javascript">
	function loginOut() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/user/loginOut.action',
			success : function(data) {
				window.location.href = "${pageContext.request.contextPath}";
			}
		});

	}

	function device_effect() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/device_analysis_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function alerts() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/alerts/alerts.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function equipmanage() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/equip_manage_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function summy() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/database.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function consummonitor() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath }/jsp/consum_monitor_show.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function equipmonitor() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath }/jsp/equip_monitor_show.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function elec_meter() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/elect_meter.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function energy_usage() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/machine_show.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function energy_usage2() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/energy_usage_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function consum_plan() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/CostManager_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function consum_plan2() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/consum_plan_manage_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}
	function cost_Analysis() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/costAnalysis_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function userInfo(username) {

		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/UserInfo_show.jsp',
			data : {
				name : username
			},
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function param_config() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/param_config_show.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}
</script>

</head>

<body>
	<section id="container">
		<div class="datu"></div>
		<!--sidebar start-->
		<aside class="sidebar">

			<div id="leftside-navigation" class="nano">
				<ul class="nano-content">
					<li class="active"><a
						href="${pageContext.request.contextPath}/Nygl/index.jsp?username=<%=username%>"><i
							class="fa fa-dashboard"></i><span>首页</span></a></li>

					<li class="sub-menu"><a href="javascript:void(0);"><i
							class="fa fa-map-marker"></i><span>能源监测</span><i
							class="arrow fa fa-angle-right pull-right"></i></a>
						<ul>
							<li><a href="javascript:void(0)" onclick="consummonitor()">能耗监测</a></li>
							<li><a href="javascript:void(0)" onclick="equipmonitor()">设备检测</a></li>
							<li><a href="javascript:void(0)" onclick="elec_meter()">电表状态</a></li>
						</ul></li>

					<li class="sub-menu"><a href="javascript:void(0);"><i
							class="fa fa-map-marker"></i><span>能源管控</span><i
							class="arrow fa fa-angle-right pull-right"></i></a>
						<ul>
							<li><a href="javascript:void(0)" onclick="alerts()">故障预警</a></li>
							<li><a href="javascript:void(0)" onclick="equipmanage()">设备管理</a></li>
							<!-- <li><a href="javascript:void(0)" onclick="summy()">能源总览</a></li> -->

						</ul></li>



					<li class="sub-menu"><a href="javascript:void(0);"><i
							class="fa fa-map-marker"></i><span>数据中心</span><i
							class="arrow fa fa-angle-right pull-right"></i></a>
						<ul>
							<li><a href="javascript:void(0);" onclick="energy_usage()">能耗使用情况</a></li>
							<li><a href="javascript:void(0);" onclick="device_effect()">设备效率分析</a></li>
							<li><a href="javascript:void(0);" onclick="consum_plan()">能耗计划管理</a></li>
							<li><a href="javascript:void(0);" onclick="cost_Analysis()">成本分析</a></li>
						</ul></li>

					<li class="sub-menu"><a href="javascript:void(0);"><i
							class="fa fa-map-marker"></i><span>系统管理</span><i
							class="arrow fa fa-angle-right pull-right"></i></a>
						<ul>
							<li><a href="javascript:void(0);"
								onclick="userInfo('<%=username%>')">账户管理</a></li>
							<li><a href="javascript:void(0);" onclick="param_config()">参数配置</a></li>
						</ul></li>

					<li class="sub-menu"><a href="javascript:void(0);"><i
							class="fa fa-map-marker"></i><span>第二套方案</span><i
							class="arrow fa fa-angle-right pull-right"></i></a>
						<ul>
							<li><a href="javascript:void(0);" onclick="energy_usage2()">能耗使用情况</a></li>
							<li><a href="javascript:void(0);" onclick="consum_plan2()">能耗计划管理</a></li>
						</ul></li>

				</ul>
			</div>
		</aside>
		<!--sidebar end-->
		<!--main content start-->
		<section class="main-content-wrapper">
			<header id="header">
				<!--logo start-->
				<!--logo end-->

				<div class="toggle-navigation toggle-left">
					<button type="button" class="btn btn-default" id="toggle-left"
						data-toggle="tooltip" data-placement="right"
						title="Toggle Navigation">
						<i class="fa fa-bars"></i>
					</button>
				</div>
				<div class="user-nav">
					<ul>
						<li class="dropdown messages">
							<!-- <span
				class="badge badge-danager animated bounceIn" id="new-messages">5</span>
				<button type="button"
					class="btn btn-default dropdown-toggle options" id="toggle-mail"
					data-toggle="dropdown">
					<i class="fa fa-envelope"></i>
				</button> -->
							<ul class="dropdown-menu alert animated fadeInDown">
								<!-- <li>
						<h1>
							您有 <strong>5 </strong>条新消息
						</h1>
					</li>
					<li><a href="#">
							<div class="profile-photo">
								<img src="assets/img/avatar.gif" alt="" class="img-circle">
							</div>
							<div class="message-info">
								<span class="sender">James Bagian</span> <span class="time">30
									mins</span>
								<div class="message-content">Lorem ipsum dolor sit amet,
									elit rutrum felis sed erat augue fusce...</div>
							</div>
					</a></li>

					<li><a href="#">
							<div class="profile-photo">
								<img src="assets/img/avatar1.gif" alt="" class="img-circle">
							</div>
							<div class="message-info">
								<span class="sender">Jeffrey Ashby</span> <span class="time">2
									hour</span>
								<div class="message-content">hendrerit pellentesque, iure
									tincidunt, faucibus vitae dolor aliquam...</div>
							</div>
					</a></li>

					<li><a href="#">
							<div class="profile-photo">
								<img src="assets/img/avatar2.gif" alt="" class="img-circle">
							</div>
							<div class="message-info">
								<span class="sender">John Douey</span> <span class="time">3
									hours</span>
								<div class="message-content">Penatibus suspendisse sit
									pellentesque eu accumsan condimentum nec...</div>
							</div>
					</a></li>

					<li><a href="#">
							<div class="profile-photo">
								<img src="assets/img/avatar3.gif" alt="" class="img-circle">
							</div>
							<div class="message-info">
								<span class="sender">Ellen Baker</span> <span class="time">7
									hours</span>
								<div class="message-content">Sem dapibus in, orci bibendum
									faucibus tellus, justo arcu...</div>
							</div>
					</a></li>
					<li><a href="#">
							<div class="profile-photo">
								<img src="assets/img/avatar4.gif" alt="" class="img-circle">
							</div>
							<div class="message-info">
								<span class="sender">Ivan Bella</span> <span class="time">6
									hours</span>
								<div class="message-content">Curabitur metus faucibus
									sapien elit, ante molestie sapien...</div>
							</div>
					</a></li>
					<li><a href="mail.jsp">Check all messages <i
							class="fa fa-angle-right"></i></a></li> -->
							</ul>
						</li>
						<li class="profile-photo"><img src="assets/img/avatar1.gif"
							alt="" class="img-circle"></li>
						<li class="dropdown settings"><a class="dropdown-toggle"
							data-toggle="dropdown" href="#"> <%=username%> <i
								class="fa fa-angle-down"></i>
						</a>
							<ul class="dropdown-menu animated fadeInDown">
								<li><a href="nygl_userInfo.jsp"><i class="fa fa-user"></i>
										个人中心</a></li>
								<li><a href="#"><i class="fa fa-calendar"></i> 日程表</a></li>
								<li><a href="#"><i class="fa fa-envelope"></i> 收件箱 <!-- <span class="badge badge-danager" id="user-inbox">5</span> --></a></li>
								<li><a href="#" onclick="loginOut()"><i
										class="fa fa-power-off"></i> 退出登录</a></li>
							</ul></li>
						<li>
							<div class="toggle-navigation toggle-right">
								<!-- <button type="button" class="btn btn-default" id="toggle-right">
						<i class="fa fa-comment"></i>
					</button> -->
							</div>
						</li>

					</ul>
				</div>
			</header>

			<section id="main-content">
				<div class="row">
					<div class="col-md-12">
						<!--breadcrumbs start -->
						<ul class="breadcrumb">
							<li><a href="javascript:void(0)">能源管理系统</a></li>
							<li>能源管控</li>
							<li><a href="javascript:void(0);" onclick="summy()">能源总览</a>
						</ul>

						<!--breadcrumbs end -->
						<iframe src="../axure/page17.jsp" id="myiframe" scrolling="no"
							frameborder="0"
							style="zoom: 60%; width: 955px; height: 665px; float: left; margin-left: 45px; margin-top: 16px;">这是C</iframe>

						<iframe src="../jsp/a.jsp" id="myiframe" scrolling="no"
							frameborder="0"
							style="zoom: 60%; width: 1000px; height: 700px; float: left;">这是A</iframe>

						<iframe src="../jsp/a2.jsp" id="myiframe" scrolling="no"
							frameborder="0"
							style="zoom: 60%; width: 1000px; height: 700px; float: left;">这是B</iframe>

						<iframe src="../jsp/a3.jsp" id="myiframe" scrolling="no"
							frameborder="0"
							style="zoom: 60%; width: 1000px; height: 700px; float: left;">这是D</iframe>

					</div>
				</div>

			</section>

		</section>
		<!--main content end-->
		<!--sidebar right start-->
		<aside class="sidebarRight">
			<div id="rightside-navigation">
				<div class="sidebar-heading">
					<i class="fa fa-user"></i> Contacts
				</div>
				<div class="sidebar-title">online</div>
				<div class="list-contacts">
					<a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>James Bagian</h4>
							<p>Los Angeles, CA</p>
						</div>
						<div class="item-status item-status-online"></div>
					</a> <a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar1.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>Jeffrey Ashby</h4>
							<p>New York, NY</p>
						</div>
						<div class="item-status item-status-online"></div>
					</a> <a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar2.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>John Douey</h4>
							<p>Dallas, TX</p>
						</div>
						<div class="item-status item-status-online"></div>
					</a> <a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar3.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>Ellen Baker</h4>
							<p>London</p>
						</div>
						<div class="item-status item-status-away"></div>
					</a>
				</div>

				<div class="sidebar-title">offline</div>
				<div class="list-contacts">
					<a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar4.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>Ivan Bella</h4>
							<p>Tokyo, Japan</p>
						</div>
						<div class="item-status"></div>
					</a> <a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar5.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>Gerald Carr</h4>
							<p>Seattle, WA</p>
						</div>
						<div class="item-status"></div>
					</a> <a href="javascript:void(0)" class="list-item">
						<div class="list-item-image">
							<img src="assets/img/avatar6.gif" class="img-circle">
						</div>
						<div class="list-item-content">
							<h4>Viktor Gorbatko</h4>
							<p>Palo Alto, CA</p>
						</div>
						<div class="item-status"></div>
					</a>
				</div>
			</div>
		</aside>
		<!--sidebar right end-->
	</section>

</body>

</html>
